Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

632713 Views

Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/04 - Digital Clock

font/ cody/swapnilsparsh/30DaysOfJavaScript/04 - Digital Clock/font/
1 Items
  • sans.ttf
  • assets/ cody/swapnilsparsh/30DaysOfJavaScript/04 - Digital Clock/assets/
    1 Items
  • favicon.png
  • style.css cody/swapnilsparsh/30DaysOfJavaScript/04 - Digital Clock/style.css
    102 Views
    0 Comments
    * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "sans";
    }

    @font-face {
    index.html cody/swapnilsparsh/30DaysOfJavaScript/04 - Digital Clock/index.html
    304 Views
    0 Comments
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Digital Clock</title>
    <link rel="stylesheet" href="style.css" />
    script.js cody/swapnilsparsh/30DaysOfJavaScript/04 - Digital Clock/script.js
    161 Views
    0 Comments
    const hour = document.getElementById("hour");
    const minute = document.getElementById("minute");
    const seconds = document.getElementById("seconds");
    const ampm = document.getElementById("ampm");

    // Add 0 to the begining of number if less than 10
    function formatTime(time) {
    return time.toString().padStart(2, "0");